package com.alan.api.share.common.enums;

import lombok.Getter;

/**
 * Created by Alan on 2017/10/29.
 */
public enum RuijiangUserEnum {

    SEX_MALE("1","男"),
    SEX_FEMALE("2","女"),
    SEX_CONFIDENTIALITY("3","保密");

    @Getter
    private String code;
    @Getter
    private String desc;

    RuijiangUserEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static RuijiangUserEnum getEnumByCode(String code){
        RuijiangUserEnum[] ruijiangUserEnums = RuijiangUserEnum.values();
        for (RuijiangUserEnum ruijiangUserEnum: ruijiangUserEnums) {
            if(ruijiangUserEnum.code.equals(code)){
                return ruijiangUserEnum;
            }
        }
        return null;
    }
}
